package com.zhangbo.study.designpatternlearning.state;

public class RemoteControlSwitch {

    private State switchStart;

    private State switchStop;

    private State current;


    public RemoteControlSwitch() {
        this.switchStart = new SwitchStart(this);
        this.switchStop = new SwitchStop(this);
        current = this.switchStart;
    }


    public void start() {
        if(current.start()) {
            current = this.switchStop;
        }
    }

    public void stop() {
        if(current.stop()) {
            current = this.switchStart;
        }
    }


}
